<?php
	$w_type = validate_captcha();

	if($w_type == ''){
		if ($act == 'addsubject') {
			foreach($_POST as $key=>$el){
				if ((strpos($key, "post_") !== false) and (strpos($key, "post_") == 0)) {
					$post[$key] = strip_tags($el);
					$post[$key] = trim($post[$key]);
					$post[$key] = addslashes($post[$key]);
				}
			}
			if ((isset($_POST['post_subject'])) && (strlen($_POST['post_subject'])>0)){
				if ((isset($parent)) && (strlen($parent)>0)){
					$forumclass->forum_subject_add($parent, $post, $_SESSION['lang']);
				}
			} else $err->AddError(5);
			header ("location: ".$_SERVER['HTTP_REFERER']);
			exit();
		} elseif ($act == 'addpost'){
			foreach($_POST as $key=>$el){
				if ((strpos($key, "post_") !== false) and (strpos($key, "post_") == 0)) {
					if (strlen($el) > 0) {
						$post[$key] = strip_tags($el);
						$post[$key] = trim($post[$key]);
						$post[$key] = addslashes($post[$key]);
					}
				}
			}
			if ((isset($parent)) && (strlen($parent)>0)){
				if (count($post) > 0){
					$forumclass->forum_post_add($parent, $post, $_SESSION['lang']);
				}
			}
			header ("location: ".$_SERVER['HTTP_REFERER']);
			exit();
		}
	}//if($w_type == '')
?>